<!--
 * @FilePath: \crm\application\crm\view\index\edit_admin.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/static/crm/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/crm/css/public.css" media="all">
    <link rel="stylesheet" href="/static/crm/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">

            <form id="app-form" class="layui-form layuimini-form">
                <div class="layui-form-item">
                    <label class="layui-form-label required">登录账户</label>
                    <div class="layui-input-block">
                        <input type="text" name="account" class="layui-input" value="{$row.account|default=''}">
                        <tip>填写登录账户。</tip>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">用户姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="admin" class="layui-input" value="{$row.admin|default=''}">
                        <tip>填写管理员姓名。</tip>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">用户手机</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone" class="layui-input" lay-reqtext="请输入用户手机" placeholder="请输入用户手机"
                            value="{$row.phone|default=''}">
                        <tip>填写用户手机。</tip>
                    </div>
                </div>

                <div class="hr-line"></div>
                <div class="layui-form-item text-center" style="padding-left: 45%;">
                    <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit
                        lay-filter="edit-admin">确认</button>
                    <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
                </div>

            </form>

        </div>
    </div>
    <script src="/static/crm/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script>
        layui.use(['form', 'jquery', 'layer'], function () {
            var $ = layui.jquery,
                form = layui.form,
                layer = layui.layer;

            form.on('submit(edit-admin)', function (data) {
                $.ajax({
                    type: 'post',
                    url: "/crm/index/editAdmin",
                    dataType: 'json',
                    data: data.field,
                    success: function (result) {
                        if (result.code == 1) {
                            layer.msg(result.msg)
                        } else{
                            layer.msg(result.msg)
                        }
                    }
                })
                return false;
            });
        });
    </script>
</body>

</html>